import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import Vant, { AddressList, AddressEdit, ShareSheet, Area, Tab, Tabs, Collapse, CollapseItem, IndexBar, IndexAnchor } from 'vant'
import 'vant/lib/index.css'
import './assets/css/iconfont.css'
import VuePhoneNumberInput from 'vue-phone-number-input'
import 'vue-phone-number-input/dist/vue-phone-number-input.css'
import moment from 'moment-timezone'
import VueI18n from 'vue-i18n' // 引入I18n翻译组件
import VueAMap from 'vue-amap'

// 电话验证组件
Vue.component('vue-phone-number-input', VuePhoneNumberInput)
Vue.use(moment)

Vue.use(VueAMap)
VueAMap.initAMapApiLoader({
  key: 'f91d81856ba0a5c9b5517550f5f55aa7',
  plugin: [
    'AMap.Autocomplete', // 输入提示插件
    'AMap.PlaceSearch', // 搜索插件
    'AMap.Geolocation', // 定位控件
    'AMap.Geocoder'
  ],
  v: '1.4.4'
})

Vue.use(VueI18n)
const i18n = new VueI18n({
  // 创建 i18n 的 Vue 实例对象
  locale: 'zh-CN',
  messages: {
    'zh-CN': require('./common/lang/zh.js'), // 挂载语言包
    'en-US': require('./common/lang/en.js')
  }
})

Vue.use(Vant, AddressList, AddressEdit, ShareSheet, Area, Tab, Tabs, Collapse, CollapseItem, IndexBar, IndexAnchor)
Vue.config.productionTip = false

new Vue({
  i18n, // 挂载 i18n 实例对象
  router,
  store,
  render: h => h(App)
}).$mount('#app')
